#include "ThreadPool.hpp"
#include "Thread.hpp"

using namespace MyThread;

int main()
{
    ThreadPool<Task> *tp = new ThreadPool<Task>(5);
    tp->Init();
    tp->Start();

    int cnt = 10;
    while (cnt)
    {
        sleep(1);
        // 不断向线程池里推送任务
        Task t(1, 1);
        tp->Equeue(t);
        sleep(1);
        std::cout << "cnt: " << cnt-- << std::endl;
    }

    tp->Stop();
    std::cout << "thread pool quit" << std::endl;
    sleep(10);

    return 0;
}